<template>
	<sw-common-frame :loading="loading">
		<template slot="button">
			<el-button type="primary" size="small" title="新增敏感词" icon="el-icon-plus" @click="handleOpenDialog()">新增</el-button>
		</template>
		<template slot="query">
			<el-form size="small" :inline="true">
				<el-form-item>
					<el-input v-model="queryData.name" clearable placeholder="请输入敏感词" />
				</el-form-item>
				<el-form-item>
					<el-button type="primary" icon="el-icon-search" size="small" @click="queryTableData()">查询</el-button>
				</el-form-item>
			</el-form>
		</template>
		<template slot="table">
			<el-table :data="tableData" style="width: 100%" stripe height="100%">
				<el-table-column prop="name" label="敏感词" min-width="240"></el-table-column>
				<el-table-column prop="createName" label="创建人" min-width="100"></el-table-column>
				<el-table-column prop="createTime" label="创建时间" min-width="160"></el-table-column>
				<el-table-column prop="updateTime" label="修改时间" min-width="160"></el-table-column>
				<el-table-column label="操作" width="54">
					<template slot-scope="{ row }">
						<el-button type="text" size="medium" @click="handleDeleteData(row)">删除</el-button>
					</template>
				</el-table-column>
			</el-table>
		</template>
		<template slot="page">
			<sw-pagination :total="dataCount" :page.sync="queryData.page" :limit.sync="queryData.limit" @change="queryTableData()" />
		</template>
		<form-dialog v-model="formDialog" :data-id="dataId" @refresh="queryTableData()"></form-dialog>
	</sw-common-frame>
</template>

<script>
import formDialog from './form';
import listMixins from '@/mixins/listMixins';
import { getSensitiveList, deleteSensitive } from '@/api/system/tbSysSensitive';
export default {
	mixins: [listMixins],
	components: { formDialog },
	data() {
		return {
			pageName: '敏感词'
		};
	},
	computed: {
		listFunction() {
			return eval(getSensitiveList);
		},
		deleteFunction() {
			return eval(deleteSensitive);
		}
	}
};
</script>
